let pw = document.querySelector("#pw");
let pwn = document.querySelectorAll(".pw-n")
pw.onchange = () => {
    if (pw.value == 1) {
        pwn[0].innerHTML = `<td></td><td><input type="date" name="paymentWay-1" class="w180" id="">前支付</td>`;
        pwn[1].innerHTML = `<td></td><td></td>`;
        pwn[2].innerHTML = `<td></td>`;
    }
    if (pw.value == 2) {
        pwn[0].innerHTML = `<td></td><td>第一年 <input type="date" name="paymentWay-1" id=""> 前支付 <input type="date" name="paymentWay-2" id=""> 元</td>`;
        pwn[1].innerHTML = `<td></td><td>第二年 <input type="date" name="paymentWay-3" id=""> 前支付 <input type="date" name="paymentWay-4" id=""> 元</td>`;
        pwn[2].innerHTML = `<td></td><td>第三年 <input type="date" name="paymentWay-5" id=""> 前支付 <input type="date" name="paymentWay-6" id=""> 元</td>`;
    }
    if (pw.value == 3) {
        pwn[0].innerHTML = `<td></td><td><input type="date" name="paymentWay-1" id=""> 前支付 <input type="date" name="paymentWay-2" id=""> 元</td>`;
        pwn[1].innerHTML = `<td></td><td>剩余款项在 <input type="date" name="paymentWay-3" id=""> 前支付 <input type="date" name="paymentWay-4" id=""> 元</td>`;
        pwn[2].innerHTML = `<td></td><td></td>`;

    }
}
let qx = document.querySelector("#qx1");
let qxnr = document.querySelectorAll(".bqx1");
let yc = document.querySelectorAll(".ycnr")
qx.onclick = function() {
    if (this.checked == true) {
        for (let i = 0; i < qxnr.length; i++) {
            qxnr[i].checked = true;
            yc[i].style.visibility = "visible";
        }
    } else {
        for (let i = 0; i < qxnr.length; i++) {
            qxnr[i].checked = false;
            yc[i].style.visibility = "hidden";
        }
    }
}

for (let i = 0; i < yc.length; i++) {
    qxnr[i].onclick = function() {
        if (this.checked == true) {
            yc[i].style.visibility = "visible";
        } else {
            yc[i].style.visibility = "hidden";
        }
    }
}